/*!
 * =====================================================
 * Lucn v1.0 (http://huaiyangxian.com)
 * =====================================================
 */
/**
 * 判断浏览器类型
 */
(function(w) {
    var pcm = readCookie('pcm');
    //var ua  = w.navigator.userAgent;
	var ua  = w.navigator.userAgent.toLocaleLowerCase();
    var url = $('html').attr('data-mobile_url');
    var matchedRE = /iphone|android|symbianos|windows\sphone/g;
    function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ') {
                c = c.substring(1, c.length)
            }
            if (c.indexOf(nameEQ) == 0) {
                return c.substring(nameEQ.length, c.length)
            }
        }
        return null
    }

    if ( matchedRE.test(ua) && pcm != '1' ) {
        w.location.href = url;
        return false;
    }
})(window);